package cn.zhyjohn.paysystem.service;

import cn.zhyjohn.paysystem.common.Response;
import cn.zhyjohn.paysystem.requset.AliPayParams;
import cn.zhyjohn.paysystem.requset.AliTradePayParams;
import cn.zhyjohn.paysystem.requset.AliTradePrecreateParams;
import cn.zhyjohn.paysystem.requset.AliTradeRefundParams;
import com.ijpay.alipay.AliPayApiConfig;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author JOHN
 * @title: AlipayDrud
 * @projectName paysystem
 * @since 2019/8/28
 */
public interface AlipayService {
    /**
     * 初始化客户端
     *
     * @author JOHN
     * @date 15:18
     **/
    AliPayApiConfig getAliPayApiConfig();

    /**
     * 回调
     *
     * @author JOHN
     * @date 16:34
     **/
    Map<String, String> callback(HttpServletRequest request);

    /**
     * app支付
     *
     * @param params
     * @author JOHN
     * @date 11:43
     **/
    Response appPay(AliPayParams params);

    /**
     * Wap支付
     *
     * @param params
     * @author JOHN
     * @date 11:46
     **/
    Response wapPay(HttpServletResponse response, AliPayParams params);

    /**
     * PC支付
     *
     * @param params
     * @author JOHN
     * @date 11:53
     **/
    Response pcPay(HttpServletResponse response, AliPayParams params);

    /**
     * 条码/声波支付
     *
     * @param params
     * @author JOHN
     * @date 11:59
     **/
    Response tradePay(AliTradePayParams params);

    /**
     * 扫码支付
     *
     * @param precreatePay
     * @author JOHN
     * @date 12:03
     **/
    Response tradePrecreatePay(AliTradePrecreateParams precreatePay);

    /**
     * 单笔转账到支付宝账户
     *
     * @param params
     * @author JOHN
     * @date 13:39
     **/
    Response transfer(AliPayParams params);

    /**
     * 退款
     *
     * @param params
     * @author JOHN
     * @date 13:49
     **/
    Response tradeRefund(AliTradeRefundParams params);
}
